/**
 * CActor框架相关类型定义
 */

// 性能指标类型
export interface PerformanceMetrics {
  timestamp: number;
  throughput: number; // 消息吞吐量
  latency: number; // 延迟时间 (ns)
  actorCount: number; // Actor数量
  memoryUsage: number; // 内存使用率 (%)
  cpuUsage: number; // CPU使用率 (%)
}

// 架构层级类型
export interface ArchitectureLayer {
  id: string;
  name: string;
  description: string;
  components: string[];
  color: string;
}

// 交易流程类型
export interface TradingFlow {
  steps: TradingStep[];
  totalTime: number;
  throughput: number;
}

export interface TradingStep {
  id: string;
  name: string;
  actor: string;
  duration: number;
  status: 'pending' | 'processing' | 'completed' | 'failed';
}

// 金融解决方案类型
export interface FinancialSolution {
  id: string;
  title: string;
  description: string;
  features: string[];
  metrics: PerformanceMetrics;
  codeExample?: string;
}

// 案例研究类型
export interface CaseStudy {
  id: string;
  title: string;
  company: string;
  industry: string;
  challenge: string;
  solution: string;
  results: string[];
  metrics: {
    performanceImprovement: string;
    costReduction: string;
    reliability: string;
  };
}

// 导航菜单类型
export interface NavItem {
  title: string;
  href: string;
  description?: string;
  items?: NavItem[];
}

// 代码示例类型
export interface CodeExample {
  title: string;
  language: 'cangjie' | 'typescript' | 'json' | 'shell';
  code: string;
  description?: string;
}

// 主题配置类型
export interface ThemeConfig {
  mode: 'light' | 'dark' | 'system';
  primaryColor: string;
  radius: number;
}

// 响应式断点类型
export type Breakpoint = 'sm' | 'md' | 'lg' | 'xl' | '2xl';

// 动画配置类型
export interface AnimationConfig {
  duration: number;
  easing: string;
  delay?: number;
}

// 图表数据类型
export interface ChartData {
  name: string;
  value: number;
  color?: string;
}

// API响应类型
export interface ApiResponse<T = unknown> {
  success: boolean;
  data?: T;
  error?: string;
  message?: string;
}

// 搜索结果类型
export interface SearchResult {
  id: string;
  title: string;
  content: string;
  url: string;
  type: 'page' | 'doc' | 'example';
}

// 用户偏好设置类型
export interface UserPreferences {
  theme: ThemeConfig;
  language: 'zh' | 'en';
  notifications: boolean;
  analytics: boolean;
}
